/**
* project  edu.lagou.com   stage1_module1
* @author libaice 
* @email libaice147@gmail.com
*/
import java.util.*;

public class yearmonthdate
{
	public static void main (String[] args){
		


		System.out.println("Please input the day you want to check, And seperated them by a blankSapce");
		Scanner sc = new Scanner(System.in);
		int year = sc.nextInt();
		int month = sc.nextInt();
		int date = sc.nextInt();// input the year , month, and date

		int[] monthArr = {31, 28,31,30,31,30,31,31,30,31,30,31}; // generate an array 

		
		if(year % 4 == 0 && (year % 400 == 0 || year % 100 != 0)){
			monthArr[1] = 29;
			
		} // check whethe the year is a leap year (I) can be divided by 400 (II) can be divided by 4 and cannot by 100
		//System.out.println(monthArr[1]);

		if(month < 1 || month > 12){
			System.out.println("The month you have printed is wrong, please exectute the program again ");
			return;  //return can exit the main Method
		}
		if(date< 0|| date > monthArr[month-1] ){
			System.out.println("The date you have printed is wrong, please exectute the program again ");
			return;
		}


		int days = 0;
		for(int i =1; i< month;i++){
			days += monthArr[i-1];
		}
		days += date;  
		
		System.out.println("the day you have printed is the " + days + "'s day of the year" );
		

	}
}